from selenium.webdriver.common.by import By

from base  import Base
class Page(Base):
    def sousuo(self):
        loc = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().text("搜索菜谱")')
        ele = self.find_ele(loc)
        return ele

    def shuruneironf(self):
        loc = (  By.CLASS_NAME, 'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele

    def dianjisousuo(self):
        loc = (By.XPATH, '//android.widget.TextView[@text="搜索"]')
        ele = self.find_ele(loc)
        return ele

    def tu(self):
        loc = (By.XPATH, '(//android.widget.ImageView[@resource-id="com.xiachufang:id/common_photo_image_view"])[1]')
        ele = self.find_ele(loc)
        return ele

    def pinglun(self):
        loc = (By.ID, 'com.xiachufang:id/recipe_bto_nav_bar_comment')
        ele = self.find_ele(loc)
        return ele

    def shuruneirong(self):
        loc = (By.XPATH, '//android.widget.TextView[@resource-id="com.xiachufang:id/recipe_bto_nav_bar_comment_btn"]')
        ele = self.find_ele(loc)
        return ele

    def shurusousuoneir1(self):
        loc = (By.CLASS_NAME, 'android.widget.EditText')
        ele = self.find_ele(loc)
        return ele

    def dianjifasong(self):
        loc = (By.XPATH, '//android.widget.TextView[@resource-id="com.xiachufang:id/tv_comment_publish_btn"]')
        ele = self.find_ele(loc)
        return ele

    def fanhui(self):
        loc = (By.XPATH, '//android.widget.ImageView[@content-desc="返回"]')
        ele = self.find_ele(loc)
        return ele

    def shaixuan(self):
        loc = (By.ACCESSIBILITY_ID, '更多筛选条件按钮')
        ele = self.find_ele(loc)
        return ele

    def fanhui2(self):
        loc = (By.XPATH, '//android.widget.ImageView[@content-desc="返回"]')
        ele = self.find_ele(loc)
        return ele

    def duanyan(self):
        loc = (By.XPATH, '//android.widget.TextView[@text="搜索"]')
        ele = self.find_ele(loc)
        return ele

    def zonghe(self):
        loc = (By.XPATH, '//android.widget.TextView[@text="综合"]')
        ele = self.find_ele(loc)
        return ele

    def yemian(self):
        loc = (By.XPATH, '//android.widget.TextView[@resource-id="com.xiachufang:id/tv_load_status_major"]')
        ele = self.find_ele(loc)
        return ele